

function reg() {
    axios.get("user/add",{
        params: {
            name:$("userName").value,
            pwd:$("pwd").value,
            mail:$("emil").value,
            img:get()
        }
    }).then(resp =>{
        if (resp.data == "ok"){
            land();
        }
        else {
            $("errorDiv").innerHTML = "已有帐户，注册失败";
        }
    })
}

function get() {
    let img = document.getElementsByName("head");
    for (let i=0;i< img.length;i++){
        if (img[i].checked == true){
            return img[i].value;
        }
    }
}